<style type="text/css">
    .ui.container{width: 1200px;}
    .ui.table thead th, .ui.table tr td{
        text-align:center;
    }
</style>
<!--内容区开始-->
<div class="cont">
    <!-- 标签页 -->
    <div class="ui top attached tabular menu">
        <a class="item active" ng-click="first()" data-tab="first"><font>我的日志</font></a>
        <a class="item" ng-click="second()" data-tab="second"><font> 审核日志 </font></a>
    </div>
    <!-- 我的日志界面 -->
    <div class="ui bottom attached tab segment active" style=" border: none" data-tab="first">
        <div class="menus" >
            <div class="menus_top">
                <div class="menus_l"><img alt="查看方式图标" src="dist/images/zt.png"/>查看方式</div>
                <ul id="nav">
                    <li class="selected"><a ng-click="selLogtype(0)">全部</a></li>
                    <li><a ng-click="selLogtype(1)">日报</a></li>
                    <li><a ng-click="selLogtype(2)">周报</a></li>
                    <li><a ng-click="selLogtype(3)">月报</a></li>
                </ul>
                <ol style="margin-top:0px;">
                    <li><a ng-click="showAdd()" class="btn">添加日志</a></li> 
                </ol>
            </div>
            <div class="menus_con" style="margin-top:-12px;">
                <ul>
                    <li>
                        <label for="textfield" class="li_lable">标题</label>
                        <input type="text" ng-model="s_title" placeholder="标题" ng-keyup="$event.keyCode == 13 && search()">
                    </li>
                    <li>
                        <label for="textfield" class="li_lable" >内容</label>
                        <input type="text" ng-model="s_content"  placeholder="内容" ng-keyup="$event.keyCode == 13 && search()">
                    </li>
                    <a ng-click="search()">搜索</a>
                </ul>
            </div>
            <div class="menus_table" style="margin-top:-25px;">
                <table class="ui column table">
                    <thead>
                        <tr>
                            <th>标题</th>
                            <th>创建时间</th>
                            <th>最后更新</th>
                            <th>审核状态</th>
                            <th colspan="2">操作</th>
                        </tr>
                    </thead>
                    <tbody ng-show="rcode == 1">
                        <tr ng-repeat="vlog in logs">
                            <td><a href="" ng-click="showmylog()" style="cursor: pointer;text-decoration:underline;">
                                【{{vlog.typename}}】- {{vlog.title}}</a></td>                       
                            <td>{{vlog.create_time}}</td>
                            <td>{{vlog.update_time}}</td>
                            <td>
                                <span ng-if="vlog.audit_res == 0" >未审核</span>
                                <span ng-if="vlog.audit_res == 1" >已通过</span>
                                <span ng-if="vlog.audit_res == 2" >未通过</span>
                            </td>
                            <td>
                                <img src="dist/images/edit.png" rel="{{vlog.log_id}}" ng-click="showEdit()" ng-show="vlog.audit_res != 1 " alt="编辑按钮" title="编辑"/>
                                <button class="ui small blue icon button" rel="{{vlogs.log_id}}" ng-click="showLogs()"  ng-show="vlog.audit_res == 1 ">
                                    <i class="unhide icon"></i>查看
                                </button>
                            </td>
                            <td>
                                <img src="dist/images/del.png" rel="{{vlog.log_id}}" ng-click="delLog()" title="删除" alt="删除按钮"/>
                            </td>
                        </tr>
                    </tbody>
                    <tbody ng-show="rcode == 2">
                        <tr ng-show="!busy">
                            <td colspan="6"  style="text-align:center;margin-top:10px" class="null_data">没有找到数据~~~</td>
                        </tr>  
                    </tbody>
                    <tfoot ng-if="logspage.pageAll >1">
                        <tr>
                            <th colspan="6">
                                <div class="ui pagination menu" jspagination page-object="logspage" page-func="logDataList"></div>
                            </th>
                        </tr>
                    </tfoot>
                </table>
            </div>
        </div>
    </div>
    <!-- 审核日志界面 -->
    <div class="ui bottom attached tab segment" style=" border: none" data-tab="second">
        <div class="menus" >
            <div class="menus_top">
                <div class="menus_l"><img alt="查看方式图标" src="dist/images/zt.png"/>查看方式</div>
                <ul id="nav">
                    <li class="selected"><a ng-click="rewLogtype(0)">全部</a></li>
                    <li><a ng-click="rewLogtype(1)">日报</a></li>
                    <li><a ng-click="rewLogtype(2)">周报</a></li>
                    <li><a ng-click="rewLogtype(3)">月报</a></li>
                </ul>
                <div style="margin:0 10px 0px 20px;margin-top: 10px;">
                    <a class="show_style clicks" ng-click="reviewLogList(1)" id="today" style="margin-left:20px;">待审核</a>
                    <a class="show_style" ng-click="reviewLogList(2)" id="week">已审核</a>
                    <a class="show_style" ng-click="reviewLogList(3)" id="month">全部</a>
                </div>
            </div>
            <div class="menus_con">
                <ul>
                    <li>
                        <label for="textfield" class="li_lable">标题</label>
                        <input type="text" ng-model="rs_title" id="r_title" name="r_title" placeholder="标题" ng-keyup="$event.keyCode == 13 && rs_search()">
                    </li>
                    <li>
                        <label for="textfield" class="li_lable">创建人</label>
                        <input type="text" ng-model="rs_nickname" id="rs_nickname" name="rs_nickname" placeholder="创建人" ng-keyup="$event.keyCode == 13 && rs_search()">
                    </li>
                    <a ng-click="rs_search()">搜索</a>
                </ul>
            </div>
            <div class="menus_table">
                <table class="ui column table">
                    <thead>
                        <tr>
                            <th>标题</th>
                            <th>创建人</th>
                            <th>创建时间</th>
                            <th>部门</th>
                            <th>角色</th>
                            <th>审核状态</th>
                            <th>操作</th>
                        </tr>
                    </thead>
                    <tbody id="y_log_list">
                        <tr ng-repeat="vlogs in r_logs">
                            <td><a href="" ng-click="showReview()" style="cursor: pointer;text-decoration:underline;">
                                【{{vlogs.typename}}】- {{vlogs.title}}</a></td>
                            <td>{{vlogs.nickname}}</td>
                            <td>{{vlogs.create_time}}</td>
                            <td>{{vlogs.sector_name}}</td>
                            <td>{{vlogs.role_name}}</td>
                            <td>
                                <span ng-if="vlogs.audit_res == 0" >未审核</span>
                                <span ng-if="vlogs.audit_res == 1" >已通过</span>
                                <span ng-if="vlogs.audit_res == 2" >未通过</span>
                            </td>
                            <td>
                                <span ng-show="vlogs.audit_res == 2 && vlogs.update_time < vlogs.audit_time" style="color:red;">{{vlogs.audit_msg}}</span>
                                <span ng-show="vlogs.audit_res == 1" style="color:green;">审核通过</span>
                                <img src="dist/images/edit.png" rel="{{vlogs.log_id}}" ng-click="reviewLog()" 
                                ng-show="vlogs.audit_res == 0 || (vlogs.audit_res == 2 && vlogs.update_time > vlogs.audit_time)"alt="审核按钮" title="审核"/>
                            </td>
                        </tr>
                    </tbody>
                    <tbody id="w_log_list">
                        <tr ng-show="!busy">
                            <td colspan="7" style="text-align:center;margin-top:10px" class="null_data">没有找到数据~~~</td>
                        </tr>  
                    </tbody>
                    <tfoot ng-if="logspage2.pageAll > 1" id="logspages_shows">
                        <tr>
                            <th colspan="7">
                                <div class="ui pagination menu" jspagination page-object="logspage2" page-func="reviewLogList"></div>
                            </th>
                        </tr>
                    </tfoot>
                </table>
            </div>
        </div>
    </div>
</div>
<!--内容区结束-->

<!-- 审核日志后，查看审核信息 -->
<div class="ui longs test modal">
    <i class="close icon"></i>
    <div class="header_h4">
        查看日志审核信息
    </div>
    <div class="content">
        <form action="#" name="frm-showview" id="frm-showview">
            <input type="hidden" name="log_id" ng-model="showview_log_id">
            <div class="ui form">
                <div class="inline fluid fields">
                    <div class="field" style="width:50%">
                        <label>日志标题:</label>
                        <div class="ui left icon input" style="width:70%" id="view_title"></div>
                    </div>
                    <div class="field" style="width:50%">
                        <label style="display:inline-block;">日志类型:</label>
                        <div class="twelve wide field" id="view_type_name" style="display:inline-block;"></div>
                    </div>
                </div>
                
                <div class="field">
                    <label>日志内容:</label>
                    <div contenteditable style="border-style:solid; border-width:1px; border-color:LightGrey; overflow-y:hidden; overflow-x:hidden; min-height:200px;padding-top:10px;padding-left:10px; " id="viewLogContentss" onfocus="this.blur();"></div>
                </div>
                <div class="inline fluid fields">
                    <div class="field" style="width:50%">
                        <label>审核时间：</label>
                        <div class="ui left icon input" style="width:70%" name="view_audit_time" id="view_audit_time"></div>
                    </div>
                    <div class="field" style="width:50%">
                        <label style="display:inline-block;">审核人：</label>
                        <div class="twelve wide field" style="display:inline-block;" id="view_nickname"></div>
                    </div>
                </div>
                <div class="field">
                    <label>审核说明:</label>
                    <div id="view_audit_msglog" style="height:5px;"></div>
                </div>
            </div>
        </form>
    </div>
    <div class="actions ">
        <div class="center">
            <div class="ui pop_btn_qd positive">返回</div>
        </div>
    </div>
</div>

<!-- 查看我的日志审核情况 -->
<div class="ui shows viewedlogs modal">
    <i class="close icon"></i>
    <div class="header_h4">
        查看审核日志情况
    </div>
    <div class="content">
        <form action="#" name="frm-showlog" id="frm-showlog">
            <input type="hidden" name="log_id" ng-model="view_log_id">
            <div class="ui form">
                <div class="inline fluid fields">
                    <div class="field" style="width:50%">
                        <label>日志标题:</label>
                        <div class="ui left icon input" style="width:70%" id="log_title"></div>
                    </div>
                    <div class="field" style="width:50%">
                        <label style="display:inline-block;">日志类型:</label>
                        <div class="twelve wide field" id="log_type_name" style="display:inline-block;"></div>
                    </div>
                </div>
                
                <div class="field">
                    <label>日志内容:</label>
                    <div  contenteditable id="log_contents" style="overflow-y:hidden;overflow-x:hidden;min-height:200px;">
                    </div>
                </div>
                <div class="inline fluid fields">
                    <div class="field" style="width:50%">
                        <label>审核时间：</label>
                        <div class="ui left icon input" style="width:70%" name="log_audit_time" id="log_audit_time"></div>
                    </div>
                    <div class="field" style="width:50%">
                        <label style="display:inline-block;">审核人：</label>
                        <div class="twelve wide field" style="display:inline-block;"  name="lognickname">{{nickname}}</div>
                    </div>
                </div>
                <div class="field">
                    <label>审核说明:</label>
                    <div name="log_audit_msglog" id="log_audit_msglog" style="height:5px;" ng-Model="richtxtMsgLogs"></div>
                </div>
            </div>
        </form>
    </div>
    <div class="actions ">
        <div class="center">
            <div class="ui pop_btn_qd positive">返回</div>
        </div>
    </div>
</div>

<!-- 查看我的日志信息 -->
<div class="ui my logs show modal">
    <i class="close icon"></i>
    <div class="header_h4">
        查看日志情况
    </div>
    <div class="content">
        <form action="#" name="frm-mylog" id="frm-mylog">
            <input type="hidden" name="log_id" ng-model="show_log_id">
            <div class="ui form">
                <div class="inline fluid fields">
                    <div class="field" style="width:50%">
                        <label>日志标题:</label>
                        <div class="ui left icon input" style="width:70%" id="mylog_title"></div>
                    </div>
                    <div class="field" style="width:50%">
                        <label style="display:inline-block;">日志类型:</label>
                        <div class="twelve wide field" id="mylog_type_name" style="display:inline-block;"></div>
                    </div>
                </div>
                <div class="inline fluid fields">
                    <div class="field" style="width:50%">
                        <label>创建时间:</label>
                        <div class="ui left icon input" style="width:70%" id="mylog_create_time"></div>
                    </div>
                    <div class="field" style="width:50%">
                        <label style="display:inline-block;">更新时间:</label>
                        <div class="twelve wide field" id="mylog_update_time" style="display:inline-block;"></div>
                    </div>
                </div>
                <div class="field">
                    <label>日志内容:</label>
                    <div contenteditable id="show_mylogs" name="content" style="overflow-y:hidden;overflow-x:hidden;min-height:200px;">  
                    </div>
                </div>
                <div class="inline fluid fields" ng-show="audit_res==2">
                    <div class="field" style="width:50%">
                        <label>审核时间：</label>
                        <div class="ui left icon input" style="width:70%" name="audit_times" id="audit_times"></div>
                    </div>
                    <div class="field" style="width:50%">
                        <label style="display:inline-block;">审核人：</label>
                        <div class="twelve wide field" style="display:inline-block;"  name="lognickname">{{nickname}}</div>
                    </div>
                </div>
                <div class="field" ng-show="audit_res==2">
                    <label>审核说明:</label>
                    <div name="audit_msglogs" id="audit_msglogs" style="height:5px;" ng-Model="richtxtMsgLogs"></div>
                </div>
            </div>
        </form>
    </div>
    <div class="actions ">
        <div class="center">
            <div class="ui pop_btn_qd positive">返回</div>
        </div>
    </div>
</div>

<!-- 审核日志 -->
<div class="ui review modal">
    <i class="close icon"></i>
    <div class="header_h4">
        审核日志
    </div>
    <div class="content">
        <form action="#" name="frm-review" id="frm-review">
            <input type="hidden" ng-model="review_log_id">
            <div class="ui form">
                <div class="inline fluid fields">
                    <div class="field" style="width:50%">
                        <label><h4>日志标题:</h4></label>
                        <div class="ui left icon input" style="width:70%;border:2px;border-color:Red;" id="audit_title"></div>
                    </div>
                    <div class="field" style="width:50%">
                        <label style="display:inline-block;"><h4>日志类型:</h4></label>
                        <div class="twelve wide field" id="audit_typename" style="display:inline-block;border:2px;border-color:Red;"></div>
                    </div>
                </div>
                <div class="field" >
                    <label><h4>日志内容:</h4></label>
                    <div style="border:2px;border-color:Red;">
                        <div contenteditable style="border-style:solid; border-width:1px; border-color:LightGrey; overflow-y:hidden; overflow-x:hidden; min-height:200px;padding-top:10px;padding-left:10px;" id="audit_content" onfocus="this.blur();"></div>
                    </div>
                </div>
                <div class="field" ng-show="audit_msg!=''&&audit_res==2">
                    <label><h4>审核历史:</h4></label>
                    <div class="field" style="display:inline;margin-left:0px;">
                        <textarea name="audit_msgs" ng-model="audit_msgs" placeholder="审核说明" style="width:100%;height:20px;" onfocus="this.blur();"></textarea>
                    </div>
                </div>
                <div class="field" id="ver_infoss">
                    <label><h4>审核说明:</h4></label>
                    <textarea style="height:5px;" ng-Model="auditMsgLog"></textarea>
                </div>
                <div id="add_sty"></div>
            </div>
        </form>
    </div>
    <div class="actions" style="height:60px;">
        <div class="center">
            <div class="ui pop_btn_qd " ng-click="veriok()">通过</div>
            <div class="ui pop_btn_qx " ng-click="verino()">不通过</div>
        </div>
    </div>
</div>

<!-- 添加日志 -->
<div class="ui add modal">
    <i class="close icon"></i>
    <div class="header_h4">
        添加日志
    </div>
    <div class="content">
        <form action="#" name="frm-add" id="frm-add" style="width:94%;margin-left:3%;">
            <div class="ui form">
                <div class="fields">
                    <div class="ten wide field required">
                        <label>日志标题</label>
                        <div class="ui left icon input" style="">
                        <input type="text" name="title" placeholder="请填写日志标题"></div>
                    </div>
                    <div class="ten wide field required" id="addLog">
                        <label>日志类型</label>
                        <div class="ui selection dropdown" style="">
                            <input type="hidden" name="type">
                            <div class="default text">请选择日志类型</div>
                            <i class="dropdown icon"></i>
                            <div class="menu">
                                <div class="item" data-value="{{sel.k}}"  ng-repeat="sel in logtypes"  >{{sel.v}}</div>
                            </div>
                        </div>
                    </div>
                </div>
                <div class="field">
                    <label>日志内容</label>
                    <div class="field required" contenteditable id="add_log_contents"  name="content" style="height:200px;" ng-Model="richtxtAdd" ></div>
                </div>
            </div>
        </form>
    </div>
    <div class="actions" style="height:60px;">
        <div class="center">
            <div class="ui pop_btn_qd positive">确定</div>
            <div class="ui pop_btn_qx negative" >取消</div>
        </div>
    </div>
</div>

<!-- 编辑日志 -->
<div class="ui edit modal">
    <i class="close icon"></i>
    <div class="header_h4">
        修改日志
    </div>
    <div class="content">
        <form action="#" name="frm-edit" id="frm-edit">
        <input type="hidden" ng-model="edit_log_id" name="log_id">
        <div class="ui form">
            <div class="inline fluid fields">
                <div class="field" style="">
                    <label>日志标题</label>
                    <div class="ui left icon input" style="">
                        <input type="text" name="title" ng-model="edit_title" placeholder="请填写日志标题">
                    </div>
                </div>
                <div class="field" style="">
                    <label>日志类型</label>
                    <div class="ui selection dropdown" id="edit-sel">
                        <input type="hidden" name="type">
                        <div class="default text">请选择日志类型</div>
                        <i class="dropdown icon"></i>
                        <div class="menu">
                            <div class="item" data-value="{{sel.k}}"  ng-repeat="sel in logtypes"  >{{sel.v}}</div>
                        </div>
                    </div>
                </div>
            </div>
            <div class="inline fields" style="margin-top:5px;">
                <div class="field" style="">
                    <label>创建时间</label>
                    <div class="ui left icon input">
                      <input type="text"  name="create_time" ng-model="edit_create_time" disabled="true" />
                      <i class="calendar icon"></i>
                    </div>
                </div>
                <div class="field" style="">
                    <label>更新时间</label>
                    <div class="ui left icon input">
                      <input type="text" name="update_time" ng-model="edit_update_time" disabled="true" />
                      <i class="calendar icon"></i>
                    </div>
                </div>
            </div>
            <div class="field">
                <label>日志内容</label>
                <div contenteditable id="edit_content" name="content" style="height:200px;" ng-Model="richtxtEditLog"></div>
            </div>
        </div>
    </form>
    </div>
    <div class="actions" style="height:60px;">
        <div class="center">
            <div class="ui pop_btn_qd positive">确定</div>
            <div class="ui pop_btn_qx negative" >取消</div>
        </div>
    </div>
</div>

<!-- 确认删除 -->
<div class="ui small del modal transition"  id="del-model" >
    <div class="header_h4">
        删除日志信息确认
    </div>
    <div class="content">
        <p></p>
    </div>
    <div class="actions">
        <div class="center">
            <div class="ui pop_btn_qd negative">确定</div>
            <div class="ui pop_btn_qx positive" >取消</div>            
        </div>
    </div>
</div>

<!-- 系统信息弹出层 is ending here-->
<div class="ui systemerror modal transition" >
    <div class="header_h4">
        系统提示
    </div>
    <div class="content">
        <div class="inline fluid fields">
            <div class="field" style="display: inline-block;width: 5%;" ng-show="logRcode==1">
                <i class="thumbs up large icon"></i>
            </div>
            <div class="field" style="display: inline-block;width: 5%;" ng-show="logRcode==0">
                <i class="thumbs down large icon"></i>
            </div>
            <div class="field" style="display: inline-block;">
                <p>{{logMsg}}</p>
            </div>
        </div> 
    </div>
    <div class="actions">
        <div class="center">
            <div class="ui pop_btn_qd positive">关闭</div>
        </div>
    </div>
</div>
<!-- 系统信息弹出层 is ending here-->
<style type="text/css">
 a:hover{cursor: pointer;text-decoration:underline;color:Black;}
.show_style{margin-right: 30px;text-decoration:underline;cursor: pointer; color:#2185D0;}
.clicks{color:Black;text-decoration:underline;cursor: pointer;}
.menus_top{margin-top:0px;}
.menus_con{margin-top:-10px;}
.menus_table{margin-top:-15px;}
</style>
<script type="text/javascript">
    $(function(){
        $('.ui.dropdown').dropdown();
        $('#frm-add').form({
            on: 'blur',
            inline : true,
            fields: {
              name: {
                identifier: 'title',
                rules: [
                  {
                    type   : 'empty',
                    prompt : '日志标题不能为空'
                  }
                ]},
               type:{
                identifier: 'type',
                rules: [
                  {
                    type   : 'empty',
                    prompt : '日志类型不能为空'
                  }
                ]},
                content:{
                identifier: 'content',
                rules: [
                  {
                    type   : 'empty',
                    prompt : '日志内容不能为空'
                  }
                ]},
            }});
        $('#frm-edit').form({
            on: 'blur',
            inline : true,
            fields: {
              name: {
                identifier: 'title',
                rules: [
                  {
                    type   : 'empty',
                    prompt : '日志标题不能为空'
                  }
                ]},
                type:{
                identifier: 'type',
                rules: [
                  {
                    type   : 'empty',
                    prompt : '日志类型不能为空'
                  }
                ]
               }
            }});
        $('#frm-review').form({
            on: 'blur',
            inline : true,
            fields: {
                audit_msg:{
                identifier: 'audit_msg',
                rules: [
                  {
                    type   : 'empty',
                    prompt : '审核信息不能为空'
                  }
                ]}
            }});
    });
$('.menu .item').tab();
$(".show_style").click(function(){
    $(this).addClass("clicks").siblings().removeClass("clicks"); 
  }); 
$("#nav li").click(function(){
       $(this).addClass('selected').siblings().removeClass('selected');
    }); 
</script>